package com.yjk.controller;


import com.yjk.entity.Danwei;
import com.yjk.entity.Renmin;
import com.yjk.service.IDanweiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yjk
 * @since 2022-04-05
 */
@RestController
@RequestMapping("/danwei")
public class DanweiController {
    @Autowired
    private IDanweiService ds;

    @GetMapping("/")
    public List<Danwei> selectAll(){
        return ds.list();
    }
    @PostMapping("/add")
    public String AddRenmin(@RequestBody Danwei clazz){
        ds.save(clazz);
        return "true";
    }
}

